/*
 * This is written by Lulu Han.
 * E-mail: locomotive_crypto@163.com
 */

#include <iostream>
#include "net_client.h"

int main(){
	
	NetClient client("127.0.0.1", 11333); // define the Client object
	
	client.connect(); // connect to the target server
	
	// Testing for sending or receiving data
	long n;
	client.receive(n);
	std::cout << "n = " << n << std::endl << std::endl;
	
	NTL::ZZ zz;
	zz = 7654321;
	client.send(zz);
	
	std::string str;
	client.receive(str);
	std::cout << "str = " << str << std::endl << std::endl;
	
	std::vector<NTL::ZZ> vzz;
	client.receive(vzz);
	std::cout << "vzz = ";
	for(auto ele : vzz){
		std::cout << ele << " ";
	}
	std::cout << std::endl;
	
	std::vector<std::vector<NTL::ZZ>> vvzz;
	vvzz.push_back(vzz); vvzz.push_back(vzz); vvzz.push_back(vzz);
	client.send(vvzz);
	
	NTL::RR r;
	client.receive(r);
	std::cout << "r = " << r << std::endl;
	
	client.close();
	client.run();
	return 0;
}
